package com.campus.service.impl;

import com.campus.dao.ActivityDao;
import com.campus.model.Activity;
import com.campus.service.ActivityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author HLQ
 * @date 2024/11/19 9:32
 */
@Service
@Slf4j
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityDao activityDao;
    @Override
    public int createActivity(Activity activity){
        return activityDao.addActivity(activity);
    }
    @Override
    public int updateActivityById(Activity activity) {
        return activityDao.updateActivityById(activity);
    }
    public int publishActivityById(int status, int id) {
        return activityDao.updateStatusById(status, id);
    }
    @Override
    public List<Activity> queryActivityByStatus(int status) {
        return activityDao.queryActivityByStatus(status);
    }
    @Override
    public List<Activity> fuzzyMatchingActivityByName(String name){
        return activityDao.fuzzyMatchingActivityByName(name);
    }
}
